﻿using Digitalmes.Infrastructure.Ftp;

namespace Digitalmes.Infrastructure;

public static class FtpSetup
{
    /// <summary>
    /// 添加 FTP 注入服务。
    /// </summary>
    /// <param name="services"></param>
    /// <param name="configuration"></param>
    /// <param name="name"></param>
    public static IServiceCollection AddFtpSetup(this IServiceCollection services, IConfiguration configuration, string name = "Ftp")
    {
        services.Configure<FtpOptions>(configuration.GetSection(name));
        services.AddTransient<IFluentFtpClient, FluentFtpClient>();

        return services;
    }
}
